home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / tiff / imtypes.h < prev    next >
Text File  |  1988-11-02  |  1KB  |  44 lines

  1. /* imtypes.c - imaging generic typedefs
  2.  */
  3.  
  4. /****************** typedefs ********************/
  5.  
  6. /* FAR pointer typedefs
  7.  */
  8. typedef    short FAR    *LPSHORT;
  9. typedef long FAR    *LPLONG;
  10. typedef BYTE FAR    *LPBYTE;
  11. typedef WORD FAR    *LPWORD;
  12. typedef DWORD FAR    *LPDWORD;
  13. typedef HANDLE FAR    *LPHANDLE;
  14. typedef SINT FAR    *LPSINT;
  15.  
  16. typedef PVOID        PDLOC;    /* to allow imaging routines to pass a hidden
  17.                              * data location structure, for eventual
  18.                              * use by the vio.c routines.
  19.                              */
  20.  
  21. /***************** constants and macros *******************/
  22.  
  23. #ifndef MAXSHORT
  24.  #define    MAXSHORT        (0x7FFF)        /* maximum 16-bit signed int */
  25.  #define    MINSHORT        (0x8000)
  26.  #define    MAXWORD            ((WORD)0xFFFF)    /* maximum 16-bit unsigned int */
  27.  #define    MAXLONG            0x7FFFFFFFL        /* maximum 32-bit signed int */
  28.  #define    MAXDWORD        ((DWORD)0xFFFFFFFFL)/* max 32-bit unsigned int */
  29. #endif
  30.  
  31. /* macros for computing BytesPerRow and Word-Aligned BytesPerRow
  32.  *  w=width of row in pixels
  33.  *  b=BitsPerSample
  34.  *  s=SamplesPerPixel
  35.  */
  36. #define UBPR(w,b,s)        (((w)*(b)*(s)+7)>>3)
  37. #define UWABPR(w,b,s)    ((((w)*(b)*(s)+15)>>4)<<1)
  38.  
  39. /* NULL shorthands:
  40.  */
  41. #define HNULL    ((HANDLE)NULL)
  42. #define BFNULL    ((BYTE FAR *)NULL)
  43. #define LPNULL    ((LPSTR)NULL)
  44.